﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace CoreLims.Models.CoreLims
{
    using AuditTrail = AuditAuditTrail;

    public partial class Audit
    {
        /// <summary>
        /// 异常、跟踪。系统中的异常及需要被记录并通知相关人员的跟踪信息都记录在此表中。
        /// </summary>
        public static AuditTrail AuditTrail;

        /// <summary>
        /// 返回一个日志实例
        /// </summary>
        public static AuditTrail newAudit => new AuditTrail();
    }

    public partial class AuditAuditTrail
    {
        public string Id { get; set; }

        /// <summary>
        /// 事件名称
        /// </summary>
        public string EventName { get; set; }

        /// <summary>
        /// 产生事件记录的表名或者是产生该事件的函数名
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// 产生事件的记录ID
        /// </summary>
        public string RecordId { get; set; }

        /// <summary>
        /// 审核人 处理该事件的人员ID
        /// </summary>
        public string AuditorId { get; set; }

        /// <summary>
        /// 审核人 处理该事件的人员姓名
        /// </summary>
        public string AuditorName { get; set; }

        /// <summary>
        /// 审核时间 处理该时间的时间
        /// </summary>
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 该事件的记录时间
        /// </summary>
        public DateTime LogTime { get; set; }

        /// <summary>
        /// 对事件的说明，比如“启用”“禁用”等
        /// </summary>
        public string Explain { get; set; }

        /// <summary>
        /// 产生事件的流程ID
        /// </summary>
        public string WorkFlowId { get; set; }

        /// <summary>
        /// 产生事件的记录快照（记录转换成的 JSON 字符串）
        /// </summary>
        public string Snapshot { get; set; }

        /// <summary>
        /// 提醒人ID
        /// </summary>
        public string RemindUserId { get; set; }

        /// <summary>
        /// 提醒人姓名
        /// </summary>
        public string RemindUserName { get; set; }

        /// <summary>
        /// 提醒组ID
        /// </summary>
        public string RemindGroupId { get; set; }

        /// <summary>
        /// 提醒组名
        /// </summary>
        public string RemindGroupName { get; set; }

        public AuditAuditTrail()
        {
            this.Id = Guid.NewGuid().ToString();
            this.LogTime = DateTime.Now;
        }
    }

}
